//
//  BaseLocationTableCell.m
//  customer
//
//  Created by Holothurian on 2018/11/1.
//  Copyright © 2018年 yinlong. All rights reserved.
//

#import "BaseLocationTableCell.h"

@implementation BaseLocationTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        AutoWeakSelf
        UIImageView *positionImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"placePicker"]];
        positionImgView.contentMode = UIViewContentModeScaleAspectFit;
        [self.contentView addSubview:positionImgView];
        [positionImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf.contentView).offset(15);
            make.left.equalTo(weakSelf.contentView).offset(15);
            make.size.mas_equalTo(CGSizeMake(20, 20));
        }];
        
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [HSPublic colorWithHexString:@"333333"];
        _nameLabel.font = Font(15);
        [self.contentView addSubview:_nameLabel];
       
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf.contentView);
            make.left.equalTo(weakSelf.contentView).offset(40);
            make.size.mas_equalTo(CGSizeMake(F_DEVICE_W - 75, 25));
        }];
        
        _subTitleLabel = [[UILabel alloc]init];
        _subTitleLabel.textColor = [HSPublic colorWithHexString:@"B2B2B2"];
        _subTitleLabel.font = Font(12);
        [self.contentView addSubview:_subTitleLabel];
        [_subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf.nameLabel.mas_bottom).offset(0);
            make.left.equalTo(weakSelf.contentView).offset(40);
            make.size.mas_equalTo(CGSizeMake(F_DEVICE_W - 75, 25));
        }];
        
        _selectImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"locationSelectImg"]];
        _selectImgView.contentMode = UIViewContentModeScaleAspectFit;
        _selectImgView.hidden = YES;
        [self.contentView addSubview:_selectImgView];
        [_selectImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView).offset(-15);
            make.centerY.equalTo(weakSelf.contentView);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end


@implementation BaseLocationTopTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _nameLabel = [[UILabel alloc]init];
        _nameLabel.textColor = [HSPublic colorWithHexString:@"333333"];
        _nameLabel.font = Font(15);
        [self.contentView addSubview:_nameLabel];
        AutoWeakSelf
        [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(weakSelf.contentView);
            make.left.equalTo(weakSelf.contentView).offset(15);
            make.size.mas_equalTo(CGSizeMake(F_DEVICE_W - 50, 50));
        }];
        
        _selectImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"locationSelectImg"]];
        _selectImgView.contentMode = UIViewContentModeScaleAspectFit;
        _selectImgView.hidden = YES;
        [self.contentView addSubview:_selectImgView];
        [_selectImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(weakSelf.contentView).offset(-15);
            make.centerY.equalTo(weakSelf.contentView);
            make.size.mas_equalTo(CGSizeMake(15, 15));
        }];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

@end
